package ${packageName}.service.impl;

import ${packageName}.model.${modelName};
import ${packageName}.mapper.${mapperName};
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;

@Service
public class ${serviceImplName} implements ${serviceName} {

    @Autowired
    ${mapperName} ${mapperName?uncap_first};

    public List<${modelName}> getAll${modelName}s(){
        return ${mapperName?uncap_first}.getAll${modelName}s();
    }

    public ${modelName} get${modelName}ById(<#list primaryKeys as column>${column.type} ${column.propertyName?uncap_first}<#if column_has_next>, </#if></#list>) {
        return ${mapperName?uncap_first}.get${modelName}ById(<#list primaryKeys as column>${column.propertyName?uncap_first}<#if column_has_next>, </#if></#list>);
    }

    public Integer update${modelName}ById(${modelName} ${modelName?uncap_first}) {
        return ${mapperName?uncap_first}.update${modelName}ById(${modelName?uncap_first});
    }

    public Integer delete${modelName}ById(<#list primaryKeys as column>${column.type} ${column.propertyName?uncap_first}<#if column_has_next>, </#if></#list>) {
        return ${mapperName?uncap_first}.delete${modelName}ById(<#list primaryKeys as column>${column.propertyName?uncap_first}<#if column_has_next>, </#if></#list>);
    }

    public Integer add${modelName}(${modelName} ${modelName?uncap_first}) {
        return ${mapperName?uncap_first}.add${modelName}(${modelName?uncap_first});
    }

    public Integer deleteAll${modelName}s() {
        return ${mapperName?uncap_first}.deleteAll${modelName}s();
    }
}